package com.zrwl.poscloud.xo.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zrwl.poscloud.base.entity.CompanyDictData;
import com.zrwl.poscloud.base.entity.Employee;
import com.zrwl.poscloud.base.entity.ImportBatch;
import com.zrwl.poscloud.base.entity.ImportDetail;
import com.zrwl.poscloud.base.superI.SuperService;
import com.zrwl.poscloud.xo.vo.*;

import java.util.List;
import java.util.Map;

/**
 * 持卡人员 服务类
 *
 * @author 刘思童 AutoGenerate
 * @date 2021-02-09
 */
public interface EmployeeService extends SuperService<Employee> {

    public IPage<EmployeeVO> getPageList(EmployeeVO employeeVO);

    /**
     * 获取同名持卡人列表
     * @param employeeVO
     * @return
     */
    public IPage<EmployeeVO> getNameSakeList(EmployeeVO employeeVO);

    public IPage<EmployeeVO> getListForSelect(EmployeeVO employeeVO);

    public List<Employee> getAllList(EmployeeVO employeeVO);

    public String add(EmployeeVO employeeVO);

    public String edit(EmployeeVO employeeVO);

    public String delete(EmployeeVO employeeVO);

    public String batchLeave(List<EmployeeVO> employeeVOS);

    public String leave(EmployeeVO employeeVO);

    public Boolean exitCertCode(String companyCode, String certCode);

    public String restore(EmployeeVO employeeVO) ;

    public String batchRestore(List<EmployeeVO> employeeVOS);

    /**
     * 身份证号转换生日和性别
     *
     * @param employeeVO
     * @return
     */
    public EmployeeVO certCodeTrans(EmployeeVO employeeVO);

    public List batchUploadEmployee(List<Map<String, String>> list, String superCompanyCode, Integer type, Integer payLevel, boolean ignoreDuplicates);

    public IPage<EmployeeVO> mobileUserGetList(EmployeeVO employeeVO);

    public EmployeeAccountRecordVO getVerifyEmployee(EmployeeVO employeeVO) ;
    /**
     * 批量导入
     *
     * @param importDetailList   数据源
     * @param importBatch        数据批次
     * @param adminVO            管理员
     * @param columnConfigMap    列配置
     * @param payLevelList
     * @param sexList
     * @param deptRoleTreeEntity
     * @return 是否错误
     */
    public int batchForImport(List<ImportDetail> importDetailList, ImportBatch importBatch, AdminVO adminVO, Map<String, String> columnConfigMap, List<CompanyDictData> payLevelList, List<SysDictDataVO> sexList, Map<String, DeptVO> deptRoleTreeEntity);

    /**
     * 从卡务插入人员(编号号或身份证号,当前商户判重导入)
     *
     * @param row             当前数据
     * @param companyCode     当前商户code
     * @param whetherToCreate 是否创建人员
     * @return EmployeeVO 人员对象
     */
    public EmployeeVO employeeIsItEffective(Map<String, String> row, String companyCode, boolean whetherToCreate) ;

    /**
     * 人员的有效性 根据机构或商户的companyCode，在employee表中寻找名称匹配的employee对象,若没有则创建该人员
     *
     * @param employeeVO      当前数据
     * @param companyCode     当前商户code
     * @param whetherToCreate 是否创建人员
     * @param replace         是否更新人员信息
     * @param judgment        判重
     * @param empty           判空
     * @return EmployeeVO 人员对象
     */
    public EmployeeVO employeeIsItEffective(EmployeeVO employeeVO, String companyCode, boolean whetherToCreate, boolean replace, boolean judgment, boolean empty,AdminVO adminVO) ;

    /**
     * 单条导入
     *
     * @param importDetail       当前数据
     * @param importBatch        当前数据批次
     * @param adminVO            当前管理员
     * @param columnConfigMap    列配置
     * @param payLevelList
     * @param sexList
     * @param deptRoleTreeEntity
     * @return EmployeeVO 人员对象
     * @throws Exception 错误信息
     */
    public EmployeeVO singleImport(ImportDetail importDetail, ImportBatch importBatch, AdminVO adminVO, Map<String, String> columnConfigMap, List<CompanyDictData> payLevelList, List<SysDictDataVO> sexList, Map<String, DeptVO> deptRoleTreeEntity) ;

    public String getAutoEmployeeCode() ;
    public String getAutoEmployeeCode(String companyUid) ;
/*    public String GenerateRecords(EmployeeVO employeeVO, int type) ;*/

    public String batchModifyLimit(EmployeeVO employeeVO) ;
    /**
     * 通过UID获取手机端需要的详细人员展示数据
     * @param employeeVO
     * @return
     */
    public EmployeeVO getEmployeeDetailForMobile(EmployeeVO employeeVO);

    /**
     * 绑定管理员
     * @param employeeVO
     * @return
     */
    String editAdmin(EmployeeVO employeeVO);

    /**
     * 获取管理员绑定持卡人列表
     * @param employeeVO
     * @return
     */
    public List<EmployeeVO> getAdminBindEmployeeList(EmployeeVO employeeVO);

    Employee getByCode(String value);

    Employee getByCertCode(String value);

    public List<Employee> getAllEmployeeListByCompanyCode(String companyCode);

    /**
     * 处理远程变动记录
     * @param employeeVO
     * @return
     */
    String HandelChangeRecord(EmployeeVO employeeVO);

    /**
     * 获取教师信息
     * @param employeeVO
     * @return
     */
    public List<EmployeeVO> getTeacherInfo(EmployeeVO employeeVO);
    public List<EmployeeVO> getGradeTeacherInfo(EmployeeVO employeeVO);

    String editEmployeeChange(EmployeeVO employeeVO);

    Employee getByCode(String companyCode, String employeeCode);
    String editNameSake(EmployeeVO employeeVO);
    List<EmployeeVO> getEmployeeListByDeptUid(String deptUid);

    List<EmployeeVO> getTeacherMesByCodeAndNameOrCertCode(EmployeeVO employeeVO);
    /**
     * 通过编号和姓名或身份证号获取持卡人信息
     *
     * @param employeeVO
     * @return
     */
    public List<EmployeeVO> getEmployeeMesByCodeAndNameOrCertCode(EmployeeVO employeeVO);

    EmployeeVO getEmployeeMesByCodeAndNameOrCertCodeAndSuffix(EmployeeVO employeeVO);
    List<EmployeeVO> getEmployeeAllListByGrade(String gradeUid);
    List<EmployeeVO> getGradeStudentInfo(EmployeeVO employeeVO);

    List<EmployeeVO> getAdminBindTeacherList(EmployeeVO employeeVO);

    List<EmployeeVO> getNoGradeTeacherMesByCodeAndNameOrCertCode(EmployeeVO employeeVO);
}
